<?php
defined('IN_XLP') or exit('Access Denied');
$Document = array(
    'pageid'   => 'finance-refund_info', //页面标示
    'pagename' => '退款详情', //当前页面名称
    'mycss'    => array(), //加载的css样式表
    'myjs'     => array(), //加载的js脚本
    'footerjs' => array(),
    'head'     => false, //加载头部文件
);
include getTpl('header', 'public');
?>
<style>
.pt7{padding-top:7px;text-align:left;}
.tc{text-align:center;}
.txl{width:300px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.table tbody tr{height:30px;}
.table tbody tr td{line-height:30px;}
.table input{height:30px;width:70px;}
.form-block{float:left;list-style:none;}
.form-block li{margin:10px 0;}
.form-label{display:inline-block;width:100px;text-align:right;font-weight:bold;}
.form-text{display:inline-block;width:150px;text-align:left;padding-left:5px;}
.form-check{float:left;margin:15px 10px;}
.form-block-b{float:left;width:100%;list-style:none;margin:10px;}
.form-block-b li{float:left;clear:left;}
.form-text-b{float:left;text-align:left;padding-left:5px;}
.form-label-b{float:left;width:100px;text-align:right;font-weight:bold;}
.clear{clear:both;}
.red{color:red;}
</style>
<form class="form-horizontal" method="post" id="processForm">
    <ul class="form-block">
        <li>
            <div class="form-label">UID:</div>
            <div class="form-text"><?php echo $refund['user_id']; ?></div>
        </li>
        <li>
            <div class="form-label">收件人:</div>
            <div class="form-text"><?php echo $refund['recipient']; ?></div>
        </li>
        <li>
            <div class="form-label">订单号:</div>
            <div class="form-text"><?php echo $refund['order_sn']; ?></div>
        </li>
        <li>
            <div class="form-label">订单总计:</div>
            <div class="form-text">￥<?php echo $order_info['order_amount']; ?></div>
        </li>
    </ul>
    <ul class="form-block">
        <li>
            <div class="form-label">商品总价:</div>
            <div class="form-text">￥<?php echo $order_info['goods_amount']; ?></div>
        </li>
        <li>
            <div class="form-label">运费:</div>
            <div class="form-text">￥<?php echo $order_info['shipping_fee']; ?></div>
        </li>
        <li>
            <div class="form-label">使用结邻币:</div>
            <div class="form-text"><?php echo $order_info['score_used']; ?> 个</div>
        </li>
        <li>
            <div class="form-label">实付:</div>
            <div class="form-text red">￥<?php echo $order_info['actual_pay']; ?></div>
        </li>
    </ul>
    <ul class="form-block">
        <li>
            <div class="form-label">申请退款时间:</div>
            <div class="form-text"><?php echo date('Y-m-d H:i:s', $refund['return_time']); ?></div>
        </li>
        <li>
            <div class="form-label">客服处理时间:</div>
            <div class="form-text"><?php echo date('Y-m-d H:i:s', $refund['service_time']); ?></div>
        </li>
        <li>
            <div class="form-label">财务处理时间:</div>
            <div class="form-text"><?php echo date('Y-m-d H:i:s', $refund['finance_time']); ?></div>
        </li>
    </ul>
    <div class="clear"></div>
    <ul class="form-block-b">
        <li>
            <div class="form-label-b">退款/退货原因:</div>
            <div class="form-text-b"><?php echo $refund['return_msg']; ?></div>
        </li>
        <li>
            <div class="form-label-b">客服备注:</div>
            <div class="form-text-b">
            <?php if ($refund['service_msg']) echo $refund['service_msg']; ?>
            </div>
        </li>
        <li>
            <div class="form-label-b">财务备注:</div>
            <div class="form-text-b">
            <?php if ($refund['finance_msg']) echo $refund['finance_msg']; ?>
            </div>
        </li>        
    </ul>
    <div style="">
        <table style="width:1000px;margin:0 7px;" class="table table-striped b-t text-small">
            <thead>
                <tr>
                    <th class="tc" width="55">商品ID</th>
                    <th class="tc" width="210">商品</th>
                    <th class="tc" width="50">售价</th>
                    <th class="tc" width="65">购买数量</th>
                    <th class="tc" width="80">获得结邻币</th>
                    <th class="tc" width="90">申请退款金额</th>
                    <th class="tc" width="90">申请退货数量</th>
                    <th class="tc" width="90">实际退款金额</th>
                    <th class="tc" width="90">实际退货数量</th>
                    <th class="tc" width="90">扣除结邻币</th>
                </tr>
            </thead>
            <tbody>
                <?php $score_minus_total = 0; ?>
                <?php foreach ($order_goods as $k => $v): ?>
                <tr>
                    <td><?php echo $v['goods_id']; ?></td>
                    <td style="text-align:left;">
                        <div class="txl"><?php echo $v['goods_name']; ?></div>
                    </td>
                    <td>￥<?php echo $v['goods_price']; ?></td>
                    <td><?php echo $v['goods_num']; ?></td>
                    <td><?php echo $v['score']; ?></td>
                    <td>￥<?php echo $v['goods_refund']; ?></td>
                    <td><?php echo $v['goods_returnnum']; ?></td>
                    <td>￥<input class="input-sm inputs actual_refund" readonly type="text" name="actual_refund[<?php echo $v['id']; ?>]" value="<?php echo $v['actual_refund']; ?>"></td>
                    <td><input class="input-sm inputs" readonly type="text" name="actual_return[<?php echo $v['id']; ?>]" <?php if($v['goods_returnnum']==0) echo 'style="background:#ccc"'; ?> value="<?php echo $v['actual_return']; ?>"></td>
                    <td><input class="input-sm inputs score_minus" readonly type="text" name="score_minus[<?php echo $v['id']; ?>]" value="<?php echo $v['score_minus']; ?>"></td>
                </tr>
                <?php $score_minus_total += $v['score_minus']; ?>
                <?php endforeach ?>
            </tbody>
        </table>
        <div class="form-check">
            <input id="return_shipping_fee" disabled type="checkbox" name="return_shipping_fee" value="1" <?php if($order_info['refund_shipping']) echo 'checked'; ?> >
            <label for="return_shipping_fee">退还运费￥<?php echo $order_info['refund_shipping']; ?></label>
        </div>
        <div class="clear"></div>
        <div class="form-check">
            退款明细：
            退还买家 <span class="red" id="refund_total">￥<?php echo priceFormat($order_info['actual_refund']); ?></span> 元，
            返还结邻币 <span class="red" id="score_return"><?php echo $order_info['score_return']; ?></span> 个，
            扣除商品奖励结邻币 <span class="red" id="score_minus_total"><?php echo $score_minus_total; ?></span> 个
        </div>
        <div class="clear"></div>
    </div>
</form>
</body>
</html>